package myky.com.doctorapp.presenter

import io.reactivex.disposables.Disposable
import myky.com.doctorapp.base.BasePresenterIm
import myky.com.doctorapp.base.RxSubscribe
import myky.com.doctorapp.contract.FollowDoctorListContract
import myky.com.doctorapp.entity.FollowDoctorEntity
import myky.com.doctorapp.model.FollowDoctorListModel

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/3/18 on 17:11
 */
class FollowDoctorListPresenter : BasePresenterIm<FollowDoctorListContract.View>(),FollowDoctorListContract.Presenter{

    var followDoctorListModel:FollowDoctorListModel=FollowDoctorListModel()
    override fun pgetFollowDoctorList(size: Int) {
        followDoctorListModel.getFollowDoctorList(size).subscribe(object :RxSubscribe<List<FollowDoctorEntity.DataBean>>(){
            override fun onSuccess(t: List<FollowDoctorEntity.DataBean>) {
                mView.showContentView()
                mView.showDataSuccess(t)
            }

            override fun onFailed(code: Int, msg: String?) {
                mView.showNetErrorView()
            }

            override fun onSubscribe(d: Disposable) {
                addSubscription(d)
            }


        })
    }
}
